<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/12/1
 * Time: 16:27
 */
namespace app\common\helper;

use app\common\model\MaterialImgRelation;

class material_helper
{
    /**
     * 添加永久素材图片关联
     * @param array $info
     * @return int
     */
    public static function add_material_img_relation($info)
    {
        if (!$info) {
            return 0;
        }

        return MaterialImgRelation::create($info);
    }

    /**
     * 获取永久素材图片关联信息
     * @param array $filter
     * @return array
     */
    public static function get_material_img_info($filter)
    {
        if (!$filter) {
            return array();
        }

        return _uri('material_img_relation', $filter,'', ['id','desc']);
    }
}